package com.lmf.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class IndexController {
   /* @Autowired
   // RestTemplate restTemplate;

    *//**
     * 根据api获取数据
     *//*
    public String getList(){
        String url="https://wms.wljkxys.com/v2/advertise/getAdList";
        MultiValueMap<String,String> multiValueMap=new LinkedMultiValueMap<>();
        String id="1";
        String token="d42aad1bbe9327d2c71f8cfd2790cb0c";
        multiValueMap.add("page",id);
        HttpHeaders httpHeaders=new HttpHeaders();
        httpHeaders.set("token",token);
        //设置传参数据格式
        httpHeaders.setContentType(MediaType.valueOf(MediaType.MULTIPART_FORM_DATA_VALUE));
        HttpEntity<MultiValueMap> httpEntity=new HttpEntity<>(multiValueMap);
        ResponseEntity<? extends HttpHeaders> j=restTemplate.exchange(url, HttpMethod.GET, httpEntity,httpHeaders.getClass());
        return "ok";*/
    /*}*/
}
